/**
 * index.tsx
 *
 * This is the entry file for the application, only setup and boilerplate
 * code.
 */

import "react-app-polyfill/ie11"
import "react-app-polyfill/stable"

import * as React from "react"
import * as ReactDOM from "react-dom"
import { Provider } from "react-redux"

// Import root app
import { App } from "app"

// 默认语言为 en-US，如果你需要设置其他语言，推荐在入口文件全局设置 locale
import "moment/locale/zh-cn"
import locale from "antd/lib/locale/zh_CN"
import { ConfigProvider } from "antd"

import { HelmetProvider } from "react-helmet-async"

import "./assets/css/common.css"
import { PersistGate } from "redux-persist/integration/react"
import { persistStore } from "redux-persist"
import store from "./store"

const persistor = persistStore(store)
// const store = configureAppStore()
const MOUNT_NODE = document.getElementById("root") as HTMLElement

ReactDOM.render(
  <Provider store={store}>
    <PersistGate loading={null} persistor={persistor}>
      <HelmetProvider>
        {/* <React.StrictMode> */}
        <ConfigProvider locale={locale}>
          <App />
        </ConfigProvider>
        {/* </React.StrictMode> */}
      </HelmetProvider>
    </PersistGate>
  </Provider>,
  MOUNT_NODE
)
